<#include "/include/macros.ftl">
<@header>

</@header>
<style>
    .webuploader-pick {
        margin-top: 6px;
        height: 28px;
        line-height: 10px;
    }
</style>
<form id="publishForm" class="form-horizontal form-label-left" novalidate>
    <div class="row">
        <div class="col-md-12 col-sm-12 col-xs-12">
            <@breadcrumb>
                <ol class="breadcrumb">
                    <li><a href="/">首页</a></li>
                    <li><a href="/articles">文章列表</a></li>
                    <li class="active">发布文章-富文本编辑器</li>
                </ol>
            </@breadcrumb>
            <div class="x_panel">
                <div class="x_title">
                    <h2>发布文章 <small>富文本编辑器，切换到 <a href="/article/publishMd">Markdown编辑器</a></small></h2>
                    <div class="clearfix"></div>
                </div>
                <div class="x_content">
                    <input type="hidden" name="isMarkdown" value="0">
                    <input type="hidden" name="id">
                    <div class="item form-group">
                        <label class="control-label col-md-1 col-sm-1 col-xs-12" for="title">标题 <span class="required">*</span></label>
                        <div class="col-md-8 col-sm-8 col-xs-12">
                            <input type="text" class="form-control col-md-7 col-xs-12" name="title" id="title" required="required" placeholder="请输入标题"/>
                        </div>
                        <div class="col-md-1 col-sm-1 col-xs-12">
                            <div class="checkbox">
                                <label>
                                    <input type="checkbox" checked class="square" name="original"> 原创
                                </label>
                            </div>
                        </div>
                    </div>
                    <div class="item form-group">
                        <label class="control-label col-md-1 col-sm-1 col-xs-12" for="password">内容 <span class="required">*</span></label>
                        <div class="col-md-11 col-sm-11 col-xs-12">
                            <div id="editor" style="width: 100%;height: 430px;"></div>
                        </div>
                    </div>

                    <div class="item form-group">
                        <label class="control-label col-md-1 col-sm-1 col-xs-1" for="title">附件</label>
                        <div class="col-md-8 col-sm-8 col-xs-8">
                        <#--<input id="article-fileIds" type="hidden" name="fileIds" value=""/>-->
                        <#--<input id="input-id" type="file" class="file form-control col-md-7 col-xs-12" type="file fileloading" multiple data-preview-file-type="text" name="file">-->
                            <div id="uploader" class="wu-example">
                                <!--用来存放文件信息-->
                                <div id="thelist" class="uploader-list"></div>
                                <div class="btns">
                                <#--<button id="picker" type="button" class="btn btn-primary btn-lg">选择文件</button>-->
                                    <div id="picker">选择文件</div>
                                <#--<button id="ctlBtn" class="btn btn-default">开始上传</button>-->
                                </div>
                            </div>
                        </div>

                    </div>

                    <hr>

                    <div class="form-group">
                        <label class="control-label col-md-1 col-sm-1 col-xs-12"></label>
                        <div class="col-md-10 col-sm-10 col-xs-12">
                            <button type="button" class="btn btn-success to-choose-info"><i class="fa fa-pencil"> 发布文章</i></button>
                        </div>
                    </div>
                    <div style="height: 20px"></div>
                </div>
            </div>
        </div>
    </div>
   <@publishmodal></@publishmodal>
    <@selectGroup></@selectGroup>
</form>
<@chooseImgModal></@chooseImgModal>
<@footer>
    <script>
        articleId = '${id}';
        $(function () {
            zhyd.wangEditor.init({
                container: "#editor",
                textareaName: "content",
                uploadUrl: "/api/uploadFile",
                uploadFileName: "file",
                uploadType: "article",
                customCss: {
                    "height": "100%",
                    "max-height": "395px"
                }
            })
        });
    </script>
    <script src="/assets/js/zhyd.publish-article.js"></script>
</@footer>
